package info.techgeek.labs.patterns.singletonPattern;

public class LibraryFactory {
	
	private LibraryFactory(){
		System.out.println("inside the constructer"+instance);
	}
	
	private static LibraryFactory instance = null;
		
	public static  LibraryFactory getInstance(){
		if(instance == null){
			System.out.println("instance Created");
			synchronized(LibraryFactory.class)
			{
				if(instance == null)
			instance = new LibraryFactory();
			}
		}
		System.out.println("instance returned");
		return instance; 
	}

	public void getPublic(){
		System.out.println("You have printed a number");
	}
	
	private void getPrivate(){
		System.out.println("You have printed a String");
	}
	
	protected void getProtected(){
		System.out.println("You have printed a String");
	}
	
	void getString(){
		System.out.println("You have printed a String");
	}
	
}
